#include "config.h"

uint32 led1 = (1 << 18);  //18 bit set 1
//const uint32 led2 = (1 << 19);

void delayns(uint32 time) {
	uint32 i = 0;
	for (; time > 0; time--) {
		for (i = 0; i < 50000; i++);
	}
}

int main(int argc, char **argv) {
	uint32 i = 19;
	PINSEL2 = PINSEL2 & (~0x08);  //open GPIO
	IO1DIR = led1;				//set p1.18 output
	//IO1DIR = led2;

	while (1) {
		IO1CLR = led1;			// light it
		//IO1CLR = led2;
		delayns(50);
		IO1SET = led1;
		led1 = (1 << i);
		IO1DIR = led1;
		i += 1;
		if (26 == i) {
			i = 18;
		}
	}
	
	return 0;
}